package com.steven.design.JieGou_Pattern.adapter;

public class AutoKey implements CarKey{

    CarAdapter carAdapter;

    @Override
    public void open(String carType) {
        // dazhong内置支持
        if(carType.equalsIgnoreCase("dazhong")){
            System.out.println("默认可以开大众："+ carType);
        }else if(carType.equalsIgnoreCase("baoma")  || carType.equalsIgnoreCase("aodi")){
            carAdapter = new CarAdapter(carType);
            carAdapter.open(carType);
        }
        else{
            System.out.println("没有支持的车辆："+carType);
        }
    }
}
